<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * Constructs a default quantile scale. The arguments to this constructor are
<span class='line'>  3</span>  * optional, and equivalent to calling {@link #domain}. The default domain is
<span class='line'>  4</span>  * the empty set, and the default range is [0,1].
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * @class Represents a quantile scale; a function that maps from a value within
<span class='line'>  7</span>  * a sortable domain to a quantized numeric range. Typically, the domain is a
<span class='line'>  8</span>  * set of numbers, but any sortable value (such as strings) can be used as the
<span class='line'>  9</span>  * domain of a quantile scale. The range defaults to [0,1], with 0 corresponding
<span class='line'> 10</span>  * to the smallest value in the domain, 1 the largest, .5 the median, etc.
<span class='line'> 11</span>  *
<span class='line'> 12</span>  * &lt;p>By default, the number of quantiles in the range corresponds to the number
<span class='line'> 13</span>  * of values in the domain. The {@link #quantiles} method can be used to specify
<span class='line'> 14</span>  * an explicit number of quantiles; for example, &lt;tt>quantiles(4)&lt;/tt> produces
<span class='line'> 15</span>  * a standard quartile scale. A quartile scale's range is a set of four discrete
<span class='line'> 16</span>  * values, such as [0, 1/3, 2/3, 1]. Calling the {@link #range} method will
<span class='line'> 17</span>  * scale these discrete values accordingly, similar to {@link
<span class='line'> 18</span>  * pv.Scale.ordinal#splitFlush}.
<span class='line'> 19</span>  *
<span class='line'> 20</span>  * &lt;p>For example, given the strings ["c", "a", "b"], a default quantile scale:
<span class='line'> 21</span>  *
<span class='line'> 22</span>  * &lt;pre>pv.Scale.quantile("c", "a", "b")&lt;/pre>
<span class='line'> 23</span>  *
<span class='line'> 24</span>  * will return 0 for "a", .5 for "b", and 1 for "c".
<span class='line'> 25</span>  *
<span class='line'> 26</span>  * @extends pv.Scale
<span class='line'> 27</span>  */</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="NAME">pv.Scale.quantile</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// number of quantiles</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">      </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// max quantile index</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">      </span><span class="NAME">q</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// quantile boundaries</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">      </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// domain</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">      </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pv.Scale.linear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// range</span><span class="WHIT">
<span class='line'> 34</span> 
<span class='line'> 35</span> </span><span class="WHIT">  </span><span class="COMM">/** @private */</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">(</span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pv.search.index</span><span class="PUNC">(</span><span class="NAME">q</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 39</span> 
<span class='line'> 40</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 41</span>    * Sets or gets the quantile boundaries. By default, each element in the
<span class='line'> 42</span>    * domain is in its own quantile. If the argument to this method is a number,
<span class='line'> 43</span>    * it specifies the number of equal-sized quantiles by which to divide the
<span class='line'> 44</span>    * domain.
<span class='line'> 45</span>    *
<span class='line'> 46</span>    * &lt;p>If no arguments are specified, this method returns the quantile
<span class='line'> 47</span>    * boundaries; the first element is always the minimum value of the domain,
<span class='line'> 48</span>    * and the last element is the maximum value of the domain. Thus, the length
<span class='line'> 49</span>    * of the returned array is always one greater than the number of quantiles.
<span class='line'> 50</span>    *
<span class='line'> 51</span>    * @function
<span class='line'> 52</span>    * @name pv.Scale.quantile.prototype.quantiles
<span class='line'> 53</span>    * @param {number} x the number of quantiles.
<span class='line'> 54</span>    */</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">  </span><span class="NAME">scale.quantiles</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">      </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">        </span><span class="NAME">q</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">d</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">concat</span><span class="PUNC">(</span><span class="NAME">d</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">        </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">        </span><span class="NAME">q</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">        </span><span class="NAME">q</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT">          </span><span class="NAME">q</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">[</span><span class="PUNC">~</span><span class="PUNC">~</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">        </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">q</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> 
<span class='line'> 74</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'> 75</span>    * Sets or gets the input domain. This method can be invoked several ways:
<span class='line'> 76</span>    *
<span class='line'> 77</span>    * &lt;p>1. &lt;tt>domain(values...)&lt;/tt>
<span class='line'> 78</span>    *
<span class='line'> 79</span>    * &lt;p>Specifying the domain as a series of values is the most explicit and
<span class='line'> 80</span>    * recommended approach. However, if the domain values are derived from data,
<span class='line'> 81</span>    * you may find the second method more appropriate.
<span class='line'> 82</span>    *
<span class='line'> 83</span>    * &lt;p>2. &lt;tt>domain(array, f)&lt;/tt>
<span class='line'> 84</span>    *
<span class='line'> 85</span>    * &lt;p>Rather than enumerating the domain values as explicit arguments to this
<span class='line'> 86</span>    * method, you can specify a single argument of an array. In addition, you can
<span class='line'> 87</span>    * specify an optional accessor function to extract the domain values from the
<span class='line'> 88</span>    * array.
<span class='line'> 89</span>    *
<span class='line'> 90</span>    * &lt;p>3. &lt;tt>domain()&lt;/tt>
<span class='line'> 91</span>    *
<span class='line'> 92</span>    * &lt;p>Invoking the &lt;tt>domain&lt;/tt> method with no arguments returns the
<span class='line'> 93</span>    * current domain as an array.
<span class='line'> 94</span>    *
<span class='line'> 95</span>    * @function
<span class='line'> 96</span>    * @name pv.Scale.quantile.prototype.domain
<span class='line'> 97</span>    * @param {...} domain... domain values.
<span class='line'> 98</span>    * @returns {pv.Scale.quantile} &lt;tt>this&lt;/tt>, or the current domain.
<span class='line'> 99</span>    */</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">  </span><span class="NAME">scale.domain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">      </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">array</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">          </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">pv.map</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">          </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Array.prototype.slice.call</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">      </span><span class="NAME">d.sort</span><span class="PUNC">(</span><span class="NAME">pv.naturalOrder</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">      </span><span class="NAME">scale.quantiles</span><span class="PUNC">(</span><span class="NAME">n</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// recompute quantiles</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> 
<span class='line'>112</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>113</span>    * Sets or gets the output range. This method can be invoked several ways:
<span class='line'>114</span>    *
<span class='line'>115</span>    * &lt;p>1. &lt;tt>range(min, ..., max)&lt;/tt>
<span class='line'>116</span>    *
<span class='line'>117</span>    * &lt;p>The range may be specified as a series of numbers or colors. Most
<span class='line'>118</span>    * commonly, two numbers are specified: the minimum and maximum pixel values.
<span class='line'>119</span>    * For a color scale, values may be specified as {@link pv.Color}s or
<span class='line'>120</span>    * equivalent strings. For a diverging scale, or other subdivided non-uniform
<span class='line'>121</span>    * scales, multiple values can be specified. For example:
<span class='line'>122</span>    *
<span class='line'>123</span>    * &lt;pre>    .range("red", "white", "green")&lt;/pre>
<span class='line'>124</span>    *
<span class='line'>125</span>    * &lt;p>Currently, only numbers and colors are supported as range values. The
<span class='line'>126</span>    * number of range values must exactly match the number of domain values, or
<span class='line'>127</span>    * the behavior of the scale is undefined.
<span class='line'>128</span>    *
<span class='line'>129</span>    * &lt;p>2. &lt;tt>range()&lt;/tt>
<span class='line'>130</span>    *
<span class='line'>131</span>    * &lt;p>Invoking the &lt;tt>range&lt;/tt> method with no arguments returns the current
<span class='line'>132</span>    * range as an array of numbers or colors.
<span class='line'>133</span>    *
<span class='line'>134</span>    * @function
<span class='line'>135</span>    * @name pv.Scale.quantile.prototype.range
<span class='line'>136</span>    * @param {...} range... range values.
<span class='line'>137</span>    * @returns {pv.Scale.quantile} &lt;tt>this&lt;/tt>, or the current range.
<span class='line'>138</span>    */</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">  </span><span class="NAME">scale.range</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">      </span><span class="NAME">y.range.apply</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">y.range</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span> 
<span class='line'>147</span> </span><span class="WHIT">  </span><span class="COMM">/**
<span class='line'>148</span>    * Returns a view of this scale by the specified accessor function &lt;tt>f&lt;/tt>.
<span class='line'>149</span>    * Given a scale &lt;tt>y&lt;/tt>, &lt;tt>y.by(function(d) d.foo)&lt;/tt> is equivalent to
<span class='line'>150</span>    * &lt;tt>function(d) y(d.foo)&lt;/tt>.
<span class='line'>151</span>    *
<span class='line'>152</span>    * &lt;p>This method is provided for convenience, such that scales can be
<span class='line'>153</span>    * succinctly defined inline. For example, given an array of data elements
<span class='line'>154</span>    * that have a &lt;tt>score&lt;/tt> attribute with the domain [0, 1], the height
<span class='line'>155</span>    * property could be specified as:
<span class='line'>156</span>    *
<span class='line'>157</span>    * &lt;pre>.height(pv.Scale.linear().range(0, 480).by(function(d) d.score))&lt;/pre>
<span class='line'>158</span>    *
<span class='line'>159</span>    * This is equivalent to:
<span class='line'>160</span>    *
<span class='line'>161</span>    * &lt;pre>.height(function(d) d.score * 480)&lt;/pre>
<span class='line'>162</span>    *
<span class='line'>163</span>    * This method should be used judiciously; it is typically more clear to
<span class='line'>164</span>    * invoke the scale directly, passing in the value to be scaled.
<span class='line'>165</span>    *
<span class='line'>166</span>    * @function
<span class='line'>167</span>    * @name pv.Scale.quantile.prototype.by
<span class='line'>168</span>    * @param {function} f an accessor function.
<span class='line'>169</span>    * @returns {pv.Scale.quantile} a view of this scale by the specified
<span class='line'>170</span>    * accessor function.
<span class='line'>171</span>    */</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">  </span><span class="NAME">scale.by</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">f</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">    </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">by</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">(</span><span class="NAME">f.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">method</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">by</span><span class="PUNC">[</span><span class="NAME">method</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">[</span><span class="NAME">method</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">by</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span> 
<span class='line'>178</span> </span><span class="WHIT">  </span><span class="NAME">scale.domain.apply</span><span class="PUNC">(</span><span class="NAME">scale</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>180</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>181</span> </span></pre></body></html>